﻿using System;
using System.Web;
using System.Web.SessionState;

namespace WF.Web.Pages
{
    /// <summary>
    /// HandlerChangePwd 的摘要说明
    /// </summary>
    public class HandlerCommonCode : HrBasePage, IHttpHandler, IRequiresSessionState
    {

        public override void ProcessRequest(HttpContext context)
        {
            if (base.Valid)
            {
                ConfigHelper config = new ConfigHelper();
                if (context.Request["args"] != "get")
                {
                    if (context.Request["auto"] == "false")
                        config.CommonCode = context.Request["code"];
                    else
                        config.CommonCode = Guid.NewGuid().ToString();
                }
                context.Response.Write(config.CommonCode);
                context.Response.End();
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}